//
//  DataListCell.swift
//  E-CycleForShop
//
//  Created by enghou on 17/3/7.
//  Copyright © 2017年 xyxorigation. All rights reserved.
//

import UIKit

class DataListCell: UITableViewCell {

    
    var model : TableCellModel? {
        didSet{
            if model?.colorFlag == true {
                self.backgroundColor = UIColor.colorWithHexString(hex: "f9f9f9")
            } else {
                self.backgroundColor = UIColor.white
            }
            phoneType.text = model?.type
            payAmountLbl.text = model?.amount
            widthDrawLbl.text = model?.widthDraw
            timeLbl.text = model?.time
        }
    }
    
    @IBOutlet var separators: [UIView]!
    @IBOutlet weak var phoneType: UILabel!
    
    @IBOutlet weak var payAmountLbl: UILabel!
    
    @IBOutlet weak var widthDrawLbl: UILabel!
    
    @IBOutlet weak var timeLbl: UILabel!
    
    override func awakeFromNib() {
        super.awakeFromNib()
        for item in separators {
            item.backgroundColor = UIColor.colorWithHexString(hex: "ececec")
        }
        phoneType.textColor = UIColor.colorWithHexString(hex: "646464")
        phoneType.font = UIFont.systemFont(ofSize: 26 * YXWidthScale)
        phoneType.textAlignment = .center
        phoneType.numberOfLines = 2
        payAmountLbl.textColor = UIColor.colorWithHexString(hex: "646464")
        payAmountLbl.font = UIFont.systemFont(ofSize: 26 * YXWidthScale)
        payAmountLbl.textAlignment = .center
        
        widthDrawLbl.textColor = UIColor.colorWithHexString(hex: "646464")
        widthDrawLbl.font = UIFont.systemFont(ofSize: 26 * YXWidthScale)
        widthDrawLbl.textAlignment = .center
        
        timeLbl.textColor = UIColor.colorWithHexString(hex: "646464")
        timeLbl.font = UIFont.systemFont(ofSize: 26 * YXWidthScale)
        timeLbl.textAlignment = .center
        timeLbl.numberOfLines = 2
        // Initialization code
    }

    
    
    
    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
}
